![]() |
Kinetis SDK Demo Applications User Guide
1.0.0-beta
Freescale Semiconductor, Inc.
|
#include <string.h>#include <stdio.h>#include "device/fsl_device_registers.h"#include "fsl_debug_uart.h"#include "fsl_gpio_hal.h"#include "fsl_port_hal.h"#include "fsl_pit_driver.h"#include "fsl_adc_driver.h"#include "fsl_interrupt_manager.h"#include "fsl_clock_manager.h"#include "fsl_os_abstraction.h"#include "board.h"Data Structures | |
| struct | sparse_node_ptr |
| Define the sparse matrix node for display wave. More... | |
Macros | |
| #define | ADC_INST |
| #define | MAX_CONSOLE_COL |
| #define | NR_SAMPLES |
| #define | FREQ_INPUT |
| #define | MAX_AMPLITUDE |
| #define | DEBUG_UART_BAUD |
Functions | |
| static void | adc_isr_callback (void) |
| ADC0 interrupt handler for fetching sample data. More... | |
| static int32_t | init_adc (uint32_t instance) |
| Initialize the ADC0 for HW trigger. More... | |
| static void | init_pit_period (void) |
| Initialize the PIT for period trigger. More... | |
| void | sparse_reset (void) |
| Reset the sparse matrix. More... | |
| void | sparse_insert (uint32_t index, uint32_t value) |
| insert a node into the sparse matrix More... | |
| void | main (void) |
| Main demo function. More... | |
Variables | |
| static sync_object_t | adc_result_sync |
| static uint16_t | result |
| static sparse_node_ptr | chart_head [MAX_AMPLITUDE] |
| static sparse_node_t | chart_nodes [NR_SAMPLES] |
| static uint32_t | free_node |
| struct sparse_node_t |
| #define ADC_INST |
ADC instance
| #define DEBUG_UART_BAUD |
debug uart baudrate
| #define FREQ_INPUT |
input signal frequency, defult: 50HZ
| #define MAX_AMPLITUDE |
print chart for the sampled data
| #define MAX_CONSOLE_COL |
the console max column size
| #define NR_SAMPLES |
number of samples in one period
|
static |
|
static |
| instance | The ADC instance number |
|
static |
| void main | ( | void | ) |
| void sparse_insert | ( | uint32_t | index, |
| uint32_t | value | ||
| ) |
| index | The amplitude index |
| value | The sample count value |
| void sparse_reset | ( | void | ) |
|
static |
sync object for adc convert result
|
static |
sparse matrix head
|
static |
sparse matrix nodes
|
static |
free node slot index for chart_nodes[]
|
static |
result from ADC Rn